In [1]:
from sympy import *
init_printing() #muestra símbolos más agradab
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import numpy as np
R=lambda n,d: Rational(n,d)
In [2]:
x,y,t=symbols('x,y,t')
y=Function('y')(x) Ecuacion=Eq(y.diff(),-((x2-2*y2)/(x*y))) sol=dsolve(Ecuacion,y) Ecuacion,sol
In [3]:
z=Function('z')(x)
Ecuacionz=Eq(z.diff(),-(1-z**2)/(x*z))
solz=dsolve(Ecuacionz,z)
Ecuacionz,solz
Out[3]:
In [4]:
y=Function('y')(x)
#Ecuacion=Eq(y.diff(),((3*(1+(y/x)**2)*atan(y/x))+y/x)/(x**2))
#sol=dsolve(Ecuacion,y)
#Ecuacion,sol
In [5]:
z=Function('z')(x)
Ecuacionz=Eq(z.diff(),3*(1+z**2)*atan(z)/x)
solz=dsolve(Ecuacionz,z)
Ecuacionz,solz
Out[5]:
In [6]:
y=Function('y')(x)
Ecuacion=Eq(y.diff(),(sqrt(x**2+y**2)/x))
#sol=dsolve(Ecuacion,y)
#Ecuacion,sol
Ecuacion
Out[6]:
In [14]:
z=Function('z')(x)
Ecuacionz=Eq(z.diff(),(sqrt(1+z**2)+z)**(-1)/x)
solz=dsolve(Ecuacionz,z)
Ecuacionz, solz
Out[14]:
In [15]:
solz.subs(z,x*y).simplify()
Out[15]:
In [ ]:
supongamos $y_{0}=1$
In [16]:
x,y=symbols('x,y')
# Gráfica de ecuaciones implícitas
grafa=plot_implicit(Eq(x*y,0),show=False,aspect_ratio=(1,1))
for r in range(1,5):
ecuaaux=plot_implicit(Eq(x**2+(y-1)**2,0.2*r**2),show=False,aspect_ratio=(1,1))
grafa.append(ecuaaux[0])
for k in range(10):
grafaaux=plot((-1)**k*k*x+1,(x,-5,5),show=False,aspect_ratio=(1,1))
grafa.append(grafaaux[0])
grafa.show()
In [17]:
y=Function('y')(x)
Ecuacion=Eq(y.diff(),(x+y+4)/(x-y-6))
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[17]:
In [18]:
y=Function('y')(x)
Ecuacion=Eq(y.diff(),-y*(x+2/y)**(-1))
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[18]:
In [19]:
y=Function('y')(x)
Ecuacion=Eq((x+y**3)*y.diff(),-(y-x**3))
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[19]:
In [20]:
y=Function('y')(x)
Ecuacion=Eq(((x+x*cos(x*y)))*y.diff(),-(y+y*cos(x*y)))
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[20]:
In [21]:
y=Function('y')(x)
Ecuacion=Eq(((sin(x)*sin(y)-x*exp(y)))*y.diff(),(exp(y)+cos(x)*cos(y))/1)
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[21]:
In [22]:
y=Function('y')(x)
Ecuacion=Eq((3*x**2-y**2)*y.diff(),2*x*y)
sol=dsolve(Ecuacion,y)
Ecuacion
#sol
Out[22]:
In [23]:
#multiplico por el factor integrante
y=Function('y')(x)
Ecuacion=Eq(y**(-4)*(3*x**2-y**2)*y.diff(),2*x*y**(-3))
sol=dsolve(Ecuacion,y)
Ecuacion
#sol
Out[23]:
In [24]:
#corroboramos la solución
y=symbols('y')
equ=Eq(-x**2/y**3+1/y,c)
expr=-x**2/y**3+1/y
funx=diff(expr,x,1).simplify()
funy=diff(expr,y,1).simplify()
funx,funy
In [ ]:
y=Function('y')(x)
Ecuacion=Eq(y+(x+3*x**3*y**4)*y.diff(),)
sol=dsolve(Ecuacion,y)
Ecuacion
#sol
In [ ]:
In [ ]:
y=Function('y')(x)
Ecuacion=Eq(y+(2*x-y*exp(y))*y.diff(),)
sol=dsolve(Ecuacion,y)
Ecuacion,sol
In [25]:
y=Function('y')(x)
Ecuacion=Eq(x*y.diff()-3*y,x**4)
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[25]:
In [28]:
y=Function('y')(x)
Ecuacion=Eq((1+x**2)*y.diff()+2*x*y,cos(x)/sin(x))
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[28]:
In [30]:
y=Function('y')(x)
Ecuacion=Eq(y.diff()-2*x*y,6*x*exp(x**2))
sol=dsolve(Ecuacion,y)
Ecuacion,sol
Out[30]:
In [ ]:
In [ ]: